home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xgrabsc / XWDFile.h < prev   
C/C++ Source or Header  |  1995-05-09  |  3KB  |  102 lines

  1. #include <X11/copyright.h>
  2.  
  3. /* Copyright 1985, 1986, Massachusetts Institute of Technology */
  4.  
  5. /* $XConsortium: XWDFile.h,v 1.12 89/10/08 16:33:57 rws Exp $ */
  6. /*
  7.  * XWDFile.h    MIT Project Athena, X Window system window raster
  8.  *        image dumper, dump file format header file.
  9.  *
  10.  *  Author:    Tony Della Fera, DEC
  11.  *        27-Jun-85
  12.  * 
  13.  * Modifier:    William F. Wyatt, SAO
  14.  *              18-Nov-86  - version 6 for saving/restoring color maps
  15.  */
  16.  
  17.  
  18. /*
  19.  * This is not portable between machines of differing word sizes.  To make
  20.  * it portable, do the following things:
  21.  *
  22.  *     o  #include <X11/Xmd.h>
  23.  *     o  remove the typedef for xwdval
  24.  *     o  replace all instances of xwdval with the appropriate CARD32 ... B32
  25.  *     o  make sure that XWDFileHeader is padded to quadword boundaries
  26.  *     o  make sure the window name is written out quadword aligned
  27.  *     o  create an XWDColor structure that contains the same fields as XColor
  28.  *        but which is defined in terms of CARD32 B32, CARD16 B16, and CARD8
  29.  *     o  convert XColor structures to XWDColor structures in xwd
  30.  *     o  remove all xwdval casts from xwd
  31.  *     o  pack image data before writing out if necessary
  32.  *     o  replace casts from xwdval objects in xwud with cvtINT macros
  33.  *     o  convert XWDColor structures to XColor structures
  34.  *     o  unpack data after reading in if necessary
  35.  */
  36.  
  37.  
  38. #include "Xmd.h"
  39.  
  40. #define XWD_FILE_VERSION 7
  41. #ifdef WORD64
  42. #define sz_XWDheader 104
  43. #else
  44. #define sz_XWDheader 100
  45. #endif
  46. #define sz_XWDColor 12
  47.  
  48. typedef CARD32 xwdval;        /* for old broken programs */
  49.  
  50. typedef struct _xwd_file_header {
  51.     CARD32 header_size B32;  /* Size of the entire file header (bytes). */
  52.     CARD32 file_version B32;    /* XWD_FILE_VERSION */
  53.     CARD32 pixmap_format B32;    /* Pixmap format */
  54.     CARD32 pixmap_depth B32;    /* Pixmap depth */
  55.     CARD32 pixmap_width B32;    /* Pixmap width */
  56.     CARD32 pixmap_height B32;    /* Pixmap height */
  57.     CARD32 xoffset B32;        /* Bitmap x offset */
  58.     CARD32 byte_order B32;        /* MSBFirst, LSBFirst */
  59.     CARD32 bitmap_unit B32;        /* Bitmap unit */
  60.     CARD32 bitmap_bit_order B32;    /* MSBFirst, LSBFirst */
  61.     CARD32 bitmap_pad B32;        /* Bitmap scanline pad */
  62.     CARD32 bits_per_pixel B32;    /* Bits per pixel */
  63.     CARD32 bytes_per_line B32;    /* Bytes per scanline */
  64.     CARD32 visual_class B32;    /* Class of colormap */
  65.     CARD32 red_mask B32;        /* Z red mask */
  66.     CARD32 green_mask B32;        /* Z green mask */
  67.     CARD32 blue_mask B32;        /* Z blue mask */
  68.     CARD32 bits_per_rgb B32;    /* Log2 of distinct color values */
  69.     CARD32 colormap_entries B32;    /* Number of entries in colormap */
  70.     CARD32 ncolors B32;        /* Number of Color structures */
  71.     CARD32 window_width B32;    /* Window width */
  72.     CARD32 window_height B32;    /* Window height */
  73.     CARD32 window_x B32;        /* Window upper left X coordinate */
  74.     CARD32 window_y B32;        /* Window upper left Y coordinate */
  75.     CARD32 window_bdrwidth B32;    /* Window border width */
  76. #ifdef WORD64
  77.     CARD32 header_end B32;        /* Pad to fill out word */
  78. #endif
  79. } XWDFileHeader;
  80.  
  81. struct {
  82.         CARD32    pixel B32;
  83.         CARD16    red B16;
  84.     CARD16    green B16;
  85.     CARD16    blue B16;
  86.         CARD8    flags;
  87.         CARD8    pad;
  88. } XWDColor;
  89.  
  90.  
  91. /*
  92.  * Name - XWDFile.h
  93.  *
  94.  * ccs version:    1.1
  95.  *
  96.  * ccsid:    @(#)XWDFile.h    1.1 - 07/02/92 16:01:52
  97.  * from:     ccs/s.XWDFile.h
  98.  * date:     06/28/93 09:14:48
  99.  *
  100.  * This is XWDFile.h from XWindows v11r4
  101.  */
  102.